package com.text;

import com.Impl.collect_productDaoImpl;
import com.Impl.productDaoImpl;
import com.dao.collect_productDao;
import com.dao.productDao;
import com.entity.collect_product;
import com.entity.product;
import com.util.DataBaseUtil;

import java.sql.Connection;
import java.util.List;

public class text {
  public static void main(String[] args) {
    Connection con = DataBaseUtil.getConnection();
    productDao productDao = new productDaoImpl(con);
//    List<product> list = productDao.findAll();
//    for (product i:list) {
//      System.out.println(i.getPid()+" "+i.getSpid()+" "+i.getPname()+" "+i.getPbrief()+" "+i.getPrice()+" "+i.getPathPic());
//    }
    collect_productDao collect_productDao = new collect_productDaoImpl(con);
//    collect_product collect_product = new collect_product();
//    collect_product.setBid(1);
//    collect_product.setCname("薯片");
//    collect_product.setCprice(23.00);
//    collect_product.setCpathPic("无");
//    collect_product.setCbrief("好吃");
//    boolean flag = collect_productDao.addCollect_Product(collect_product);
//    System.out.println(flag);
    List<collect_product> list = collect_productDao.findALl();
    System.out.println("执行了");
    System.out.println("长度"+list.size());
    product product = new product();










    for (collect_product li:list) {
      System.out.println(li.getCid()+" "+li.getBid()+" "+li.getCname()+" "+li.getCbrief()+" "+li.getCprice()+" "+li.getCpathPic());
    }

  }
}
